import { CacheMemory, YearMemory } from "../model/Memory";
import { defineStore } from "pinia";

const UseCacheMemory = defineStore("cacheMemory", {
  state() {
    const cacheMemory = new CacheMemory([], new Map<string, YearMemory>(), []);
    return {
      cacheMemory: cacheMemory,
    };
  },
  actions: {
    setCacheMemory: function (cacheMemory: CacheMemory) {
      // console.log("surfaceSetting", surfaceSetting);
      // console.log('surfaceSetting',...surfaceSetting)
      this.getCacheMemory().setInfo(cacheMemory);
      // this.surfaceSetting.setInfo(...surfaceSetting);
      // this.setting = setting;
    },
    getCacheMemory: function (): CacheMemory {
      return this.cacheMemory;
    },
    // getTaskLogMap:function(timeStamp:number):CacheTaskLogMap{
    //
    //
    // },
    setCacheMemoryFileList: function (cacheMemoryFileList: Array<string>) {
      this.cacheMemory.cacheMemoryFileList = cacheMemoryFileList;
    },
    // save2:function(){
    //
    // },
  },
  getters: {},
});
export default UseCacheMemory;
